package com.example.xpvideo.annotations;

import com.example.xpvideo.validator.IsPhoneConstraintValidator;

import javax.validation.Constraint;
import javax.validation.Payload;
import java.lang.annotation.*;

/**
 * @author : 洪俊新
 * @date : 2021/2/28 15:18
 * @description:
 */
@Documented
// 指定校验器
@Constraint(validatedBy = {IsPhoneConstraintValidator.class})
@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE,
                ElementType.CONSTRUCTOR, ElementType.PARAMETER, ElementType.TYPE_USE})
@Retention(RetentionPolicy.RUNTIME)
public @interface IsPhone {
    String message() default "输入格式非手机格式";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};

}
